# Base image for HDS backend server
FROM ppc64le/centos:7.2
MAINTAINER Andy Zhang <zch@cn.ibm.com>
ENV container=docker

#link for elf lib
RUN ln -s /usr/lib64/libelf.so.1 /usr/lib64/libelf.so

# add informix group and user, then reset infomix password
RUN groupadd informix
RUN useradd -g informix -d /home/informix -m informix
RUN echo -e "informix\ninformix" | passwd informix 

# Install informix
ENV FILESERVER http://172.16.0.164:8080/base_image
ENV INST_DIR /var/setup
RUN mkdir $INST_DIR
WORKDIR $INST_DIR
ADD $FILESERVER/ids.tar .
RUN mkdir .ids && tar -xvf $INST_DIR/ids.tar -C .ids \
    && ./ids/ids_install -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=/opt/informix
WORKDIR /
RUN rm -fr $INST_DIR
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["ifx"]
